package com.interview.rtc.aigc.dao;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.interview.rtc.aigc.dto.ChatMessageDto;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
@TableName("session_history")
public class SessionHistoryDao {
    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("title")
    private String title;

    @TableField("user_id")
    private Long userId;

    @TableField("room_id")
    private String roomId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    // 添加消息列表字段
    @TableField(exist = false)
    private List<ChatMessageDto> messages;
}
